package com.litchi.activity;

import com.litchi.R;
import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class MessageCenterActivity extends Activity implements OnClickListener {

	private TextView titleTv, contentTv;
	private View msg;
	private boolean isShow=false;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_message_center);
		findViewById(R.id.img_back).setOnClickListener(this);
		contentTv = (TextView) findViewById(R.id.textView_content);
		titleTv = (TextView) findViewById(R.id.textView_title);
		msg=findViewById(R.id.msg);
		msg.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				if (isShow) {
					contentTv.setLines(1);
					isShow=false;
				}else{
					contentTv.setLines(100);
					isShow=true;
				}
			}
		});
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		
		String content=getIntent().getStringExtra("content");
		String title=getIntent().getStringExtra("title");
		if (null!=content&&null!=title) {
			contentTv.setText(content.trim());
			titleTv.setText(title.trim());
		}
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.img_back:
			finish();
			break;

		default:
			break;
		}
	}

}
